package com.example.asus.databasedemo1;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;

/**
 * Created by asus1 on 2017/11/2.
 */

public class MyDbHelper extends SQLiteOpenHelper implements BaseColumns {
    public static final String TABLE_NAME = "card";
    public static final int VERSION = 1;
    public static final String _CARDNAME = "cardName";
    public static final String _COST = "cost";

    public MyDbHelper(Context context) {
        super(context, TABLE_NAME, null, VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL("create table " + TABLE_NAME + "(" + _ID + " integer primary" +
                " key autoincrement," + _CARDNAME + " text," + _COST + " text );");
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
